#ifndef SYSTEMCALL_H
#define	SYSTEMCALL_H


#ifndef TOP_STURCT_H
#define TOP_STURCT_H
/*
Estructuras usadas por la systemcall top.
*/
typedef struct{
	char name[100];
	int pid;
	int porcentage;
	char* state;
} top_process_t;

typedef struct{
	int running;
	int blocked;
	int ready;
	int zombies;
	
	int cant;
	
	top_process_t processes[100];

} top_t;
#endif	

#ifndef PAGING_STURCT_H
#define PAGING_STURCT_H
/*
Estructuras usadas por la systemcall paging.
*/

typedef struct{
	unsigned int heap_end;
	unsigned int stack_start;
	unsigned int esp;
} paging_t;
#endif	

/*
system calls, funciones que se comunican con el kernel.
*/
int __read(int fd, void* buffer, int count);
int __write(int fd, const void* buffer, int count);
void __cpuspeed(void * ips);
int fork(void* func,char** param);
void exit(int stat);
int __waitpid(int pid,int* stat);
void yeld();
void kill(int pid, int sig);
void signal(int sig, void (*handler)(int signal));
void sleep();
void sleep2();
void wakeup(int pid);
int getpid();
void top(top_t* top);
unsigned int stacklimit(int pid);
unsigned int heaplimit(int pid);
int open(char* name, int flags);
int close(int fd);
void newstdio();
void setgName(char* name);
void setuName(char* name);
void finfo(unsigned int sector,void* buffer);
int lseek(int fd,int offset);
int fcount(unsigned int sector,int cant);
int chmod(char* pathname,int mode);
int lchown(char* pathname,char* user, char* group);
int chdir(char* pathname);
int mknode(char* pathname,int mode, int type);
void format();
void add_key_listener(int mode, int scan_code, int (*listener)());
void setpriority(int priority);
void usemytty();
void killzombies();
void setname(char* name , int pid);


#endif	/* SYSTEMCALL_H */

